package wjh.blog.pojo;

import java.util.Date;

import wjh.blog.exception.MsgException;
import wjh.blog.util.WebTool;

public class BlogComment {

	private Integer id;
	private String content;
	private Date time;
	private User user;
	private Blog blog;
	
	
	
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public Blog getBlog() {
		return blog;
	}
	public void setBlog(Blog blog) {
		this.blog = blog;
	}
	public Integer getId() {
		return id;
	}
	public void setId(Integer id) {
		this.id = id;
	}
	public String getContent() {
		return content;
	}
	public void setContent(String content) {
		this.content = content;
	}
	public Date getTime() {
		return time;
	}
	public void setTime(Date time) {
		this.time = time;
	}
	public void check() {
		if(WebTool.checkLen(content, 5,35)){
			throw new MsgException("评论内容长度错误");
		}
		if(WebTool.checkZh(content)){
			throw new MsgException("有非法字符");
		}
		content=content.trim();
	}
	
	
	
	
	
	
}
